package com.hy.appbase.entity;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.util.Date;

@Data
@MappedSuperclass
public class CommonEntity extends IdEntity{

    @Column(name = "create_time")
    private Date createTime;

    @Column(name = "create_by")
    private String createBy;

    @Column(name = "update_time")
    private Date updateTime;

    @Column(name = "update_by")
    private String updateBy;

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
        this.createTime = new Date();
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
        this.updateTime = new Date();
    }
}
